package com.phiture.erp.stock.dal.mapper;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.phiture.erp.stock.dal.entity.ErpStockInDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author YH
 * @date 2025/4/13
 */

@Mapper
public interface ErpStockInMapper extends BaseMapperX<ErpStockInDO> {
    default int updateByIdAndStatus(Long id, Integer status, ErpStockInDO updateObj) {
        return update(updateObj, new LambdaUpdateWrapper<ErpStockInDO>()
                .eq(ErpStockInDO::getId, id).eq(ErpStockInDO::getStatus, status));
    }

    default ErpStockInDO selectByNo(String no) {
        return selectOne(ErpStockInDO::getNo, no);
    }
}
